package com.cl.auth.stateless;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * 无状态的TOKEN，用来校验rest API
 */
public class StatelessToken implements AuthenticationToken {

	private static final long serialVersionUID = 1L;

	private String accessToken;
    private boolean available;

    public StatelessToken(String accessToken, boolean available) {
        this.accessToken = accessToken;
        this.available = available;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    @Override
    public Object getPrincipal() {
        return accessToken;
    }

    @Override
    public Object getCredentials() {
        return available;
    }
    
}